// parking_hardware.h
#ifndef PARKING_HARDWARE_H
#define PARKING_HARDWARE_H

// 保持原有的硬件定义
#define BUZZER_ON 0
#define BUZZER_OFF 1

#define TEST_MAGIC 'x'
#define LED1 _IO(TEST_MAGIC, 0)
#define LED2 _IO(TEST_MAGIC, 1)
#define LED3 _IO(TEST_MAGIC, 2)
#define LED4 _IO(TEST_MAGIC, 3)
#define LED_ON 0
#define LED_OFF 1

// 函数声明
int init_buzzer_device(void);
int init_led_device(void);
void control_buzzer(int state);
void control_led(int led_num, int state);
void control_all_leds(int state);
void blink_leds(int times, int delay_ms);
void buzzer_alarm(int times, int delay_ms);
void buzzer_continuous_alarm(int duration_sec);
void close_hardware_devices(void);

#endif